Repository navigation
Perf: select only the target admin policy ID in ProductMarketingWindowManager - #99063
Conversation
|
@abzokhattab Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
@codex review |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
Review: LGTM ✅Correct, well-scoped, and behavior-preserving. The selector now returns just the target policy's ID and the policy object comes from a single-member subscription, which cheapens the per-update comparison from a I checked the behavioral equivalence against the risky parts of this refactor: Correctness verification
One optional note, not a blocker: the selector still calls |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppScreen.Recording.2026-08-20.at.15.50.05.movScreen.Recording.2026-08-20.at.15.51.39.moviOS: mWeb SafariMacOS: Chrome / SafariScreen.Recording.2026-08-20.at.15.39.32.movScreen.Recording.2026-08-20.at.15.40.03.movScreen.Recording.2026-08-20.at.15.41.23.movScreen.Recording.2026-08-20.at.15.41.52.mov |
abzokhattab
left a comment
There was a problem hiding this comment.
No issues found 🚀 LGTM
mountiny
left a comment
There was a problem hiding this comment.
This makes sense to me, thank you
|
🚧 mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.4.58-0 🚀
|
No help site changes required ✅This PR is a pure performance refactor of a single file — Nothing under If you believe there's a customer-facing behavior here that the help site should cover, let me know the specific article/behavior and I'll draft it. |
|
Hi @TMisiukiewicz. Some of these test steps, specifically those involving beta flags and React DevTools, are difficult for us to reproduce. Could you please check this PR internally on your side? |
|
@TMisiukiewicz @vitHoracek Can you please confirm vendorMatching beta is on for Expensifail accounts? |
|
added for +@applause.expensifail.com |
|
@TMisiukiewicz @mountiny Validated the steps except step:9. Not sure what we are seeing console is correct. Can you please check the video CTA.2.mp4 |
|
🚀 Deployed to production by https://github.com/Beamanator in version: 9.4.58-4 🚀
Bundle Size Analysis (Sentry): |
|
@IuliiaHerets @m-natarajan I'm sorry, step with a console/devtools was some kind of an AI slop that I missed when I created the PR 🤦♂️I removed it from test plan, there is no need to test it |
Explanation of Change
ProductMarketingWindowManagersubscribed to the wholepolicy_collection with a selector returningPolicy[](every active admin policy), souseOnyxdeep-compared all of those policy objects on every policy-collection update — measured at 37ms per compare on a large account. The component only ever used that array to pick a single policy, so the selector now returns just the target policy's ID and the policy object comes from a single-memberuseOnyxsubscription (no selector, so it compares by reference).variantandshouldPrefetchTargetPolicyConnectionsnow branch on the ID instead of the object, which also removes a one-render window where the object could lag the ID and briefly flip the admin variant to the member variant. Target-policy selection (find(id === activePolicyID) ?? at(0)) and everything passed tousePolicyConnectionsPrefetch/getCtaRouteare unchanged.Perf gain: On account with ~5k policies (large customer account), around ~90ms saved on Web when opening reports from Search
Fixed Issues
$ #99064
PROPOSAL:
Tests
main— Workspace Vendors when the target workspace has the vendor feature and thevendorMatchingbeta is on, otherwise Workspace More Features.Offline tests
N/A
QA Steps
Same as tests.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari